-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
many: fix swapping back and forth between kernels with components during remodeling #15046
base: master
Are you sure you want to change the base?
many: fix swapping back and forth between kernels with components during remodeling #15046
Conversation
Wed Feb 19 18:32:08 UTC 2025 Failures:Preparing:
Executing:
Restoring:
|
88ba090
to
f9f7070
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did a pass
overlord/snapstate/snapstate.go
Outdated
// this previously created a prepare-kernel-snap task, but this was not | ||
// needed since this function is only used to swap to kernel snaps that | ||
// are still installed on the system (but not in use. this can happen | ||
// because remodeling leaves around old snaps). if the snap is | ||
// installed, then it is expected that the drivers tree is present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it feels some of this needs to go into the doc comment for (Add)LinkNewBaseOrKernel as it's actually not super clear what their exact usage conditions are
overlord/snapstate/snapstate.go
Outdated
@@ -3492,8 +3503,24 @@ func findSnapSetupTask(tasks []*state.Task) (*state.Task, *SnapSetup, error) { | |||
return nil, nil, nil | |||
} | |||
|
|||
// AddLinkNewBaseOrKernel creates the same tasks as LinkNewBaseOrKernel but adds | |||
// them to the provided task set. | |||
// LinkNewBaseOrKernel appends tasks to a given task set. This enables swapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name is wrong now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
cf19dea
to
0e52fb7
Compare
…nkNewBaseOrKernel and snapstate.AddLinkNewBaseOrKernel
…led kernel during remodel
0e52fb7
to
82bdecb
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15046 +/- ##
==========================================
+ Coverage 78.07% 78.12% +0.05%
==========================================
Files 1182 1174 -8
Lines 157743 157753 +10
==========================================
+ Hits 123154 123248 +94
+ Misses 26943 26857 -86
- Partials 7646 7648 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, some minor comments
"${NESTED_FAKESTORE_BLOB_DIR}" \ | ||
./pc-kernel-efi-pstore+efi-comp.comp | ||
|
||
restore: | | ||
systemctl stop fakedevicesvc | ||
"${TESTSTOOLS}/store-state" teardown-fake-store "${NESTED_FAKESTORE_BLOB_DIR}" | ||
|
||
execute: | | ||
echo 'Swap to the first new kernel and component pc-kernel-mac80211-hwsim+wifi-comp' | ||
gendeveloper1 sign-model < "${SECOND_MODEL_JSON}" > second-model.assert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: tabulation is inconsistent in the different parts of this yaml file. I think we tend to use 2.
# Just so that nested_prepare_kernel does not recopy the old one | ||
cp "${kernel_snap_file}" "${NESTED_ASSETS_DIR}/pc-kernel.snap" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this not needed anymore?
// TODO: it seems that removing this line doesn't break any tests | ||
expected = append(expected, tasksBeforeDiscard...) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is getting added by this PR, should not then just be removed? Not sure if I am missing something here.
This fixes and tests the case where we remodel to a kernel snap that is already installed on the system, but is not the current kernel due to a previous remodel.
Note that this PR removes the existing "prepare-kernel-snap" task from the created tasks here, because the task is superfluous in this case. The kernel's drivers tree is already generated from the original installation of the kernel.